import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {LoginingComponent} from './oidc/logining.component';
import {LoginComponent} from './oidc/login.component';
import {LogoutComponent} from './oidc/logout.component';
import {PortalLayoutComponent} from './layout/layout.component';
import {GnRouteGuard} from 'geminis-ng';

const routes: Routes = [
  {
    path: 'login',
    component: LoginComponent
  },
  {
    path: 'logining',
    component: LoginingComponent
  },
  {
    path: 'logout',
    component: LogoutComponent
  },
  {
    path: 'blank',
    loadChildren: () => import('./blank/blank.module').then(m => m.PortalBlankModule)
  },
  {
    path: 'center',
    loadChildren: () => import('./center/center.module').then(m => m.PortalCenterModule)
  },
  {
    path: '**',
    component: PortalLayoutComponent,
    canActivate: [GnRouteGuard]
  }
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes)
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {

}
